import 'dart:core';
import 'dart:ui';

/// 资源抽象类
abstract class CoreBaseString {
  String get noDataTip;

  String get connectTimeoutHint;

  String get responseTimeoutHint;

  String get responseErrorHint;

  String get httpErrorHint;

  /// 未连接
  String get disConnected;

  /// 连接中
  String get connecting;

  /// 已连接
  String get connected;

  /// 断开中
  String get disConnecting;
}

///
/// 中文资源
///
class CoreStringZh extends CoreBaseString {
  static Locale locale = const Locale('zh', 'CN');

  @override
  String get noDataTip => '暂无数据';

  @override
  String get connectTimeoutHint => "网络连接超时，请检查网络设置";

  @override
  String get responseTimeoutHint => "服务器响应超时，请稍后重试";

  @override
  String get responseErrorHint => "服务器响应异常";

  @override
  String get httpErrorHint => "请求失败，错误码：";

  @override
  String get connected => "已连接";

  @override
  String get connecting => "连接中";

  @override
  String get disConnected => "已断开";

  @override
  String get disConnecting => "断开中";
}

///
/// en resources
///
class CoreStringEn extends CoreBaseString {
  static Locale locale = const Locale('en', 'US');

  @override
  String get noDataTip => 'No data';

  @override
  String get connectTimeoutHint => "connect timeout，please check net setting";

  @override
  String get responseTimeoutHint =>
      "server response timeout，please try again later";

  @override
  String get responseErrorHint => "server response error";

  @override
  String get httpErrorHint => "request failed，error code: ";

  @override
  String get connected => "Connected";

  @override
  String get connecting => "Connecting";

  @override
  String get disConnected => "Disconnected";

  @override
  String get disConnecting => "Disconnecting";
}
